#include "httpJsonClient.h"
#include "stringUtils.h"
#include "loggerFactory.h"
#include "frame.h"
#include "httplib.h"

log4cpp::Category& HttpJsonClient::logger = LoggerFactory::getLogger("httpJsonClient");
HttpJsonClient::HttpJsonClient()
{
	contentType("application/json;charset=UTF-8");
}
void HttpJsonClient::onMessage(const httplib::Result& res)
{
	HttpClient::onMessage(res);
	if (res && res->status == 200) {
		response = StringUtils::utf8_2_wstr(res->body.c_str(), res->body.length());
	}
}
